<?php if (!defined('THINK_PATH')) exit();?>
 <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Bootstrap Admin</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="stylesheet" type="text/css" href="/TPproject/project/Public/Admin/Css/bootstrap.css">
    
    <link rel="stylesheet" type="text/css" href="/TPproject/project/Public/Admin/Css/theme.css">
    <link rel="stylesheet" href="/TPproject/project/Public/Admin/Css/font-awesome.css">

    <script src="/TPproject/project/Public/Admin/Js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/TPproject/project/Public/Admin/Js/layer.js"></script>
    <script type="text/javascript" src="/TPproject/project/Public/Admin/static/h-ui/js/H-ui.min.js"></script>
    <script type="text/javascript" src="/TPproject/project/Public/Admin/static/h-ui.admin/js/H-ui.admin.js"></script>

    <script src="/TPproject/project/Public/Admin/Js/jquery.validation/jquery.validate.js" type="text/javascript"></script>


    <!-- Demo page code -->

    <style type="text/css">
        #line-chart {
            height:300px;
            width:800px;
            margin: 0px auto;
            margin-top: 1em;
        }
        .brand { font-family: georgia, serif; }
        .brand .first {
            color: #ccc;
            font-style: italic;
        }
        .brand .second {
            color: #fff;
            font-weight: bold;
        }
        .table>thead>tr>th
        {
          text-align: center;
        }
        .table>tbody>tr>td
        {
          text-align: center;
        }
    </style>



 
    <link rel="shortcut icon" href="/TPproject/project/Public/Admin/Img/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/TPproject/project/Public/Admin/Img/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/TPproject/project/Public/Admin/Img/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/TPproject/project/Public/Admin/Img/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="/TPproject/project/Public/Admin/Img/apple-touch-icon-57-precomposed.png">
  </head>
        
        

        <div class="container-fluid">
            <div class="row-fluid">
                    
<div class="btn-toolbar">
    <button class="btn btn-primary" id="submit"><i class="icon-save"></i> 提交</button>
    <!-- <a href="#myModal" data-toggle="modal" class="btn">删除</a> -->
  <div class="btn-group">
  </div>
</div>
<div class="well">
    
    <div id="myTabContent" class="tab-content">
      <div class="tab-pane active in" id="home">
    <form id="tab">
        <label>用户名</label>
        <input type="text" value="<?php echo ($data["username"]); ?>" class="input-xlarge" name="username" id="username">
        <label>昵称</label>
        <input type="text" value="<?php echo ($data["nickname"]); ?>" class="input-xlarge" name="nickname" id="nickname">
        <label>密码</label>
        <input type="password" value="" class="input-xlarge" name="password" id="password">
        <label>确认密码</label>
        <input type="password" value="" class="input-xlarge" name="passaff" id="passaff">
        <label>手机号码</label>
        <input type="text" value="<?php echo ($data["phone"]); ?>" class="input-xlarge" name="phone" id="phone">
        <label>邮箱</label>
        <input type="text" value="<?php echo ($data["email"]); ?>" class="input-xlarge" name="email" id="email">
        <label>性别</label>
        <input type="radio" value="0" name="gender" class="input-xlarge" <?php if($data["gender"] == 0): ?>checked<?php endif; ?>>男
        <div style="width: 50px;display: inline-block;"></div>
        <input type="radio" value="1" name="gender" class="input-xlarge" <?php if($data["gender"] == 1): ?>checked<?php endif; ?>>女
       
        <label>状态</label>
        <select name="status" id="status" class="input-xlarge">
          <option value="1" <?php if($data["status"] == 1): ?>selected<?php endif; ?>>正常</option>
          <option value="0" <?php if($data["status"] == 0): ?>selected<?php endif; ?>>冻结</option>
        </select>
    </form>
      </div>
      <div class="tab-pane fade" id="profile">
    
      </div>
  </div>

</div>

<div class="modal small hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Delete Confirmation</h3>
  </div>
  <div class="modal-body">
    
    <p class="error-text"><i class="icon-warning-sign modal-icon"></i>Are you sure you want to delete the user?</p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
    <button class="btn btn-danger" data-dismiss="modal">Delete</button>
  </div>
</div>

<script type="text/javascript">

  function passaffblur(){
      var password = $('#password').val();
      var passaff = $('#passaff').val();
      if(password != passaff){
        layer.msg('两次密码不一致',{icon:2,time:1000});return false;
      }else{
        return true;
      }
  }


  $('#passaff').blur(function(){
      passaffblur();
  })


  $("#submit").click(function(){
      var formdata = $('#tab').serialize();
      

      
      if(passaffblur()){
        $.post("",formdata,function(data){
          if(data.code==1){
              layer.msg(data.info,{icon:1,time:1000},function(){
                 window.parent.location.reload();
              });
          }else{
              layer.msg(data.info,{icon:2,time:1000});
          }
        })
      }
      
      


  })
  
</script>